<?php
     $select_u = mysql_query('SELECT teacher_to FROM users WHERE username="'.$_SESSION['username'].'"');
	 $row_u = mysql_fetch_assoc($select_u);
	 
	 $select_users='SELECT * FROM groups WHERE tutorial = "'.$row_u['teacher_to'] . '"';
	 $results_users=mysql_query($select_users);
	 $broiich = mysql_num_rows($results_users);
	 ?>
	<form method='post' action='includes/first_post.php'>
		<table class='userBox' style='overflow: auto;'>
		<tr style='background-color: #b7b6b6; height: 40px;'>
			<td style="text-align: center; font-weight: bold;">Номер</td>
			<td style="text-align: center; font-weight: bold;">Група</td>
			<td style="text-align: center; font-weight: bold;">Раздел</td>
			<td style="text-align: center; font-weight: bold;">Избор</td>
		</tr>
	 <?php
	 $idd = 1;
	 if($broiich!=0){
	while($row_group=mysql_fetch_assoc($results_users)){
	   $id=$row_group['id'];
	   $title=$row_group['title_group'];
	   $tut=$row_group['tutorial'];
	   
?>
	<tr style='height: 30px; background-color: #ede7e7;'>
	<td style="text-align: center;">
	<?php
	echo $idd;
	?>
	</td>
	<td style="text-indent: 10px;">
	  <?php echo $title;?>
	  </td>
	  <td style="text-indent: 10px;">
	  <?php echo $tut;?>
	  </td>
	  <td style='text-align: center;'>
	  <a href="<?php echo 'work_groups.php?id='.$id.'';?>"><img src='options/see.png' name='<?php echo $id; ?>' alt='see' /></a> 
	  </td>
	  
	  </tr>
	  <?php
	  $idd++;
	 }
	 } else {
	 ?> <tr><td align='center'>Няма добавени групи от вас.</td></tr><?php }
?>
</table>
</form>
<br />
<br />
<br />